﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EStore.Core.Catalogs;
using System.Diagnostics.Contracts;

namespace EStore.Core.Orders
{
    public class ProductForSale
    {
        public ProductForSale(Product productBy, int quantity)
        {
            Contract.Requires<ArgumentNullException>(productBy != null, "没有产品信息");
            Contract.Requires<ArgumentException>(quantity > 0, "产品数量必须为正整数");

            this.ProductBy = ProductBy;
            this.Quantity = quantity;
        }

        public Product ProductBy { get; private set; }
        public virtual decimal SalePrice
        {
            get
            {
                return ProductBy.SalePrice;
            }
        }
        public int Quantity { get; private set; }
    }
}
